<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
      <el-form-item label="历史版本" prop="hisVersion">
        <el-select  @change="changeHisVersion($event)"  v-model="queryParams.hisVersion" placeholder="请选择历史版本号" clearable>
          <el-option
            v-for="dict in hisVersions"
            :key="dict.dictValue"
            :label="dict.dictLabel"
            :value="dict.dictValue"
            @keyup.enter.native="handleQuery"
          ></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="所属模块" prop="strModular">
        <treeselect style="width: 300px;" v-model="queryParams.strModular" :show-count="true"
                    :multiple="true"
                    :disable-branch-nodes="true"
                    @keyup.enter.native="handleQuery"
                    :options="modularTree"  placeholder="请选择所属模块" />
      </el-form-item>
      <el-form-item label="所属报表" prop="strReport">
        <treeselect style="width: 300px;" v-model="queryParams.strReport" :show-count="true"
                    :multiple="true"
                    :disable-branch-nodes="true"
                    @keyup.enter.native="handleQuery"
                    :options="reportTree"  placeholder="请选择所属报表" />
      </el-form-item>
      <el-form-item label="所属客户" prop="strCustomer">
        <treeselect style="width: 300px;" v-model="queryParams.strCustomer" :show-count="true"
                    :multiple="true"
                    :disable-branch-nodes="true"
                    @keyup.enter.native="handleQuery"
                    :options="customerTree"  placeholder="请选择所属客户" />
      </el-form-item>
      <el-form-item label="名称" prop="name"  v-show="showSearchColl">
        <el-input
          v-model="queryParams.name"
          placeholder="请输入名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="中文名称" prop="chineseName"  v-show="showSearchColl">
        <el-input
          v-model="queryParams.chineseName"
          placeholder="请输入中文名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
        <el-form-item label="语句类型" prop="type"  v-show="showSearchColl">
          <el-select v-model="queryParams.type" placeholder="请选择语句类型" clearable>
            <el-option
              v-for="dict in dict.type.datasql_type"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
              @keyup.enter.native="handleQuery"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="数据库类型" prop="dataBaseType"  v-show="showSearchColl">
          <el-select v-model="queryParams.dataBaseType" placeholder="请选择数据库类型" clearable>
            <el-option
              v-for="dict in dict.type.report_database_type"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
              @keyup.enter.native="handleQuery"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="执行顺序类型" prop="orderType"  v-show="showSearchColl">
          <el-select clearable v-model="queryParams.orderType" placeholder="请选执行顺序类型">
            <el-option
              v-for="dict in dict.type.datasql_order_type"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
              @keyup.enter.native="handleQuery"
            ></el-option>
          </el-select>
        </el-form-item>
      <el-form-item label="版本号" prop="version"  v-show="showSearchColl">
        <el-select v-model="queryParams.version" placeholder="请选择版本号" clearable>
          <el-option
            v-for="dict in dict.type.report_version"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
            @keyup.enter.native="handleQuery"
          />
        </el-select>
      </el-form-item>
        <el-form-item label="状态" prop="status" v-show="showSearchColl">
          <el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
            <el-option
              v-for="dict in dict.type.sys_common_status"
              :key="dict.value"
              :label="dict.label"
              :value="parseInt(dict.value)"
              @keyup.enter.native="handleQuery"
            />
          </el-select>
        </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['reportworld:datasql:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['reportworld:datasql:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['reportworld:datasql:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['reportworld:datasql:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" :showSearchColl.sync="showSearchColl" :searchColl="searchColl" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table border="border" v-loading="loading" max-height="550px"
              :data="datasqlList" @selection-change="handleSelectionChange"
               @sort-change="handleSortChange" @row-click="rowClick"  ref="datasql"
              :row-style="tableRowStyle">
      <el-table-column type="selection" width="55" align="center" />
        <el-table-column v-hasPermi="['reportworld:datasql:data:comparedata','reportworld:datasql:query','reportworld:datasql:demandBug']"
          label="操作" align="center" width="200" class-name="small-padding fixed-width">
            <template slot-scope="scope">
              <el-button
                size="mini"
                type="text"
                icon="el-icon-view"
                @click="handleUpdate(scope.row,false)"
                v-hasPermi="['reportworld:datasql:query']"
              >详情</el-button>
              <el-button
                size="mini"
                type="text"
                icon="el-icon-edit"
                @click="dataSqlDemandBug(scope.row)"
                v-hasPermi="['reportworld:datasql:demandBug']"
              >修改记录</el-button>
              <el-button
                size="mini"
                type="text"
                icon="el-icon-plus"
                @click="comparedata(scope.row)"
                v-hasPermi="['reportworld:datasql:data:comparedata']"
              >历史记录</el-button>
             <!-- <el-dropdown size="mini" @command="(command) => handleCommand(command, scope.row)" v-hasPermi="['reportworld:datasql:demandBug','reportworld:datasql:data:comparedata']">
                <el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>
                <el-dropdown-menu slot="dropdown">
                  <el-dropdown-item  command="dataSqlDemandBug" icon="el-icon-edit"
                                     v-hasPermi="['reportworld:datasql:demandBug']">修改记录</el-dropdown-item>
                  <el-dropdown-item  command="comparedata" icon="el-icon-edit"
                                     v-hasPermi="['reportworld:datasql:data:comparedata']">历史记录</el-dropdown-item>
                </el-dropdown-menu>
              </el-dropdown>-->
            </template>
        </el-table-column>
      <el-table-column label="名称" align="center" width="150" prop="name" :show-overflow-tooltip="true" sortable="custom" :sort-orders="['descending', 'ascending']"/>
      <el-table-column label="中文名称" align="center" width="180" prop="chineseName" :show-overflow-tooltip="true" sortable="custom" :sort-orders="['descending', 'ascending']"/>
      <el-table-column label="SQL语句" align="center" width="200" prop="datasql" :show-overflow-tooltip="true" sortable="custom" :sort-orders="['descending', 'ascending']"/>
      <el-table-column label="语句类型" width="180"  align="center" prop="type">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.datasql_type" :value="scope.row.type"/>
        </template>
      </el-table-column>
      <el-table-column label="数据库类型"  width="180"  align="center" prop="dataBaseType">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.report_database_type" :value="scope.row.dataBaseType"/>
        </template>
      </el-table-column>
      <el-table-column label="执行顺序类型"  width="180"  align="center" prop="orderType">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.datasql_order_type" :value="scope.row.orderType"/>
        </template>
      </el-table-column>
      <el-table-column label="所属模块"  width="150" align="center" prop="strModularName" :show-overflow-tooltip="true" />
      <el-table-column label="所属报表"  width="150" align="center" prop="strReportName" :show-overflow-tooltip="true" />
      <el-table-column label="所属客户"  width="150" align="center" prop="strCustomerName" :show-overflow-tooltip="true" />
      <el-table-column label="版本号" width="200"  align="center" prop="version">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.report_version" :value="scope.row.version"/>
        </template>
      </el-table-column>
      <el-table-column label="状态" width="180" align="center" prop="status">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.sys_common_status" :value="scope.row.status"/>
        </template>
      </el-table-column>
      <el-table-column label="添加时间" align="center" prop="createTime" width="180" sortable="custom" :sort-orders="['descending', 'ascending']">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime) }}</span>
        </template>
      </el-table-column>
      <el-table-column label="添加人" align="center" width="150" prop="createBy" :show-overflow-tooltip="true" sortable="custom" :sort-orders="['descending', 'ascending']"/>
      <el-table-column label="编辑时间" align="center" prop="updateTime" width="180" sortable="custom" :sort-orders="['descending', 'ascending']">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.updateTime) }}</span>
        </template>
      </el-table-column>
      <el-table-column label="编辑人" align="center" width="150" prop="updateBy" :show-overflow-tooltip="true" sortable="custom" :sort-orders="['descending', 'ascending']"/>
      <el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" sortable="custom" :sort-orders="['descending', 'ascending']"/>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改函数信息对话框 -->
    <el-dialog v-if="open"  :title="title" :close-on-click-modal ="false" :visible.sync="open" width="1200px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="110px">
        <el-row>
          <el-col :span="12">
            <el-form-item label="名称" prop="name">
              <el-input clearable v-model="form.name" placeholder="请输入名称"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="中文名称" prop="chineseName">
              <el-input clearable v-model="form.chineseName" placeholder="请输入中文名称"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="语句类型" prop="type">
              <el-select clearable v-model="form.type" placeholder="请选择语句类型">
                <el-option
                  v-for="dict in dict.type.datasql_type"
                  :key="dict.value"
                  :label="dict.label"
                  :value="parseInt(dict.value)"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="数据库类型" prop="dataBaseType">
              <el-select clearable v-model="form.dataBaseType" placeholder="请选择数据库类型">
                <el-option
                  v-for="dict in dict.type.report_database_type"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="执行顺序类型" prop="orderType">
              <el-select clearable v-model="form.orderType" placeholder="请选执行顺序类型">
                <el-option
                  v-for="dict in dict.type.datasql_order_type"
                  :key="dict.value"
                  :label="dict.label"
                  :value="parseInt(dict.value)"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="SQL语句" prop="datasql">
              <monaco-editor ref="monacoEditor"   style="border:1px solid #000;" :opts="opts"></monaco-editor>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="所属模块" prop="strModular">
              <treeselect  v-model="form.strModular"
                          :show-count="true"
                          :multiple="true"
                          :disable-branch-nodes="true"
                          :options="modularTree"
                           placeholder="请选择所属模块"/>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="所属客户" prop="strCustomer">
              <treeselect  v-model="form.strCustomer"
                          :show-count="true"
                          :multiple="true"
                          :disable-branch-nodes="true"
                          :options="customerTree"
                           placeholder="请选择所属客户"/>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="所属报表" prop="strReport">
              <treeselect  v-model="form.strReport"
                          :show-count="true"
                          :multiple="true"
                          :disable-branch-nodes="true"
                          :options="reportTree"
                           placeholder="请选择所属报表"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item   label="版本号" prop="version">
              <el-select :disabled="true" clearable v-model="form.version" placeholder="请选择版本号">
                <el-option
                  v-for="dict in dict.type.report_version"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="状态" prop="status">
              <el-radio-group v-model="form.status">
                <el-radio
                  v-for="dict in dict.type.sys_common_status"
                  :key="dict.value"
                  :label="parseInt(dict.value)"
                >{{dict.label}}
                </el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="说明" prop="remark">
              <el-input maxlength="500" clearable v-model="form.remark" type="textarea" placeholder="请输入内容"/>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" v-if="isUpdate" :loading="butloading" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>

    <el-dialog  v-if="openComparedata" :title="titleComparedata" :close-on-click-modal ="false"  :visible.sync="openComparedata" width="1200px" append-to-body>
      <compare :dataId="dataId" :dataCode="dataCode"> </compare>
      <div slot="footer" class="dialog-footer">
        <el-button @click="openComparedata = false">关 闭</el-button>
      </div>
    </el-dialog>

    <el-dialog  v-if="openDatademandbug" :title="titleDatademandbug" :close-on-click-modal ="false"  :visible.sync="openDatademandbug" width="1200px" append-to-body>
      <datademandbug :dataId="dataId" :dataCode="dataCode" :hisVersion="hisVersion"> </datademandbug>
      <div slot="footer" class="dialog-footer">
        <el-button @click="openDatademandbug = false">关 闭</el-button>
      </div>
    </el-dialog>

  </div>
</template>

<script>
import { listDatasql, getDatasql, delDatasql, addDatasql, updateDatasql,init } from "@/api/reportworld/datasql";
import { getTableRowStyle } from "@/utils/yss";
import monacoEditor from '@/components/SqlEditor';
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import compare from "@/views/reportworld/comparedata/index";
import datademandbug from "@/views/reportworld/demandbuginfo/datademandbug";

export default {
  name: "Datasql",
  components:{
    monacoEditor,
    Treeselect,
    compare,
    datademandbug
  },
  dicts: ['datasql_type', 'sys_common_status', 'report_database_type', 'report_version','datasql_order_type'],
  data() {
    const equalToDataSql = (rule, value, callback) => {
      if (this.$refs.monacoEditor.getVal()) {
        callback()
      } else {
        callback(new Error("SQL语句不能为空"));
      }
    };
    return {
      butloading:false,
      isUpdate:false,
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      searchColl:true,
      showSearchColl:false,
      // 总条数
      total: 0,
      // 函数信息表格数据
      datasqlList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      //所属模块
      modularTree : [],
      // 所属客户
      customerTree: [],
      //所属报表
      reportTree: [],
      //历史数据
      titleComparedata:'',
      openComparedata:false,
      titleDatademandbug:'',
      openDatademandbug:false,
      dataId:'',
      dataCode:'',
      // 历史版本号
      hisVersions:[],
      hisVersion:'',
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 50,
        name: null,
        chineseName: null,
        version: null,
        dataBaseType: null,
        orderType:null,
        remark: null,
        strModular:[],
        strCustomer:[],
        strReport:[],
        hisVersion:null,
      },
      opts: { //编辑器
        value: '',
        readOnly: false, // 是否可编辑
        language: 'sql', // 语言类型
        theme: 'vs', // 编辑器主题
        lineNumbers: "on", // 行号 取值
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        name: [
          {required: true, message: "名称不能为空", trigger: "blur" }
        ],
        chineseName: [
          { required: true, message: "中文名称不能为空", trigger: "blur" }
        ],
        version: [
          { required: true, message: "版本号不能为空", trigger: "change" }
        ],
        type: [
          { required: true, message: "语句类型不能为空", trigger: "change" }
        ],
        dataBaseType: [
          { required: true, message: "数据库类型不能为空", trigger: "change" }
        ],
        orderType: [
          { required: true, message: "执行顺序类型不能为空", trigger: "change" }
        ],
        datasql: [
          {
            required: true,
            validator: equalToDataSql,
            message: "SQL语句不能为空",
            trigger: ["blur"]
          }
        ],
        status: [
          { required: true, message: "状态不能为空", trigger: "change" }
        ],
      }
    };
  },
  created() {
    this.init();
    this.getList();
  },
  methods: {
    changeHisVersion(value){
      this.queryParams.hisVersion=value;
      this.init();
      this.getList();
    },
    /** 查询函数信息列表 */
    getList() {
      this.loading = true;
      listDatasql(this.queryParams).then(response => {
        this.datasqlList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    init(){
       /* this.$set(this.queryParams, "strModular", null);
        this.$set(this.queryParams, "strCustomer", null);
        this.$set(this.queryParams, "strReport", null);*/
      init(this.queryParams).then(response => {
        this.modularTree=response.modularTree;
        this.customerTree=response.customerTree;
        this.reportTree=response.reportTree;
        this.hisVersions=response.hisVersions;
    });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        name: null,
        chineseName: null,
        datasql: null,
        version: null,
        type: null,
        dataBaseType: null,
        orderType:null,
        status: null,
        createTime: null,
        createBy: null,
        updateTime: null,
        updateBy: null,
        remark: null,
        hisVersion:null,
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    dataSqlDemandBug(row){
      this.openDatademandbug =true;
      this.dataId = row.id;
      this.dataCode = 'REPORT_DATASQL_CODE';
      this.hisVersion=this.queryParams.hisVersion;
      this.titleDatademandbug = "SQL修改记录信息";
    },
    comparedata(row){
      const id = row.id;
      this.openComparedata =true;
      this.dataId = row.id;
      this.dataCode = 'REPORT_DATASQL_CODE';
      this.titleComparedata = "SQL历史记录信息";
    },
    // 更多操作触发
   /* handleCommand(command, row) {
      const id = row.id;
      switch (command) {
        case "dataSqlDemandBug":
          this.$router.push({ name:'dataDemandBug',query: {dataId:id,dataCode:'REPORT_DATASQL_CODE'} });
          break;
        case "comparedata":
          this.handleComparedata(row.id,'REPORT_DATASQL_CODE');
          break;
        default:
          break;
      }
    },*/
      /** 排序触发事件 */
    handleSortChange(column, prop, order) {
      this.queryParams.orderByColumn = column.prop;
      this.queryParams.isAsc = column.order;
      this.getList();
     },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加函数信息";
      this.isUpdate =true;
      this.opts.value= '';
      this.form.version = this.dict.type.report_version[0].value;
      if(this.queryParams.hisVersion){
        this.form.version =this.queryParams.hisVersion;
      }
      this.form.type = parseInt(this.dict.type.datasql_type[0].value);
      this.form.dataBaseType = this.dict.type.report_database_type[0].value;
      this.form.orderType = parseInt(this.dict.type.datasql_order_type[1].value);
      this.form.status = parseInt(this.dict.type.sys_common_status[0].value);
    },
    /** 修改按钮操作 */
    handleUpdate(row,isUpdate) {
      this.reset();
      const id = row.id || this.ids
      if(isUpdate == false){
        this.queryParams.id=id;
      }else{
        this.queryParams.id=id[0];
      }
      getDatasql(this.queryParams).then(response => {
        this.form = response.data;
        this.$set(this.form, "strModular", response.data.strModular);
        this.$set(this.form, "strCustomer", response.data.strCustomer);
        this.$set(this.form, "strReport", response.data.strReport);
        this.opts.value= '';
        this.opts.value= response.data.datasql;
        this.open = true;
        this.title = "修改函数信息";
      this.isUpdate =true;
      if(isUpdate == false){
        this.title = "函数信息详情";
        this.isUpdate =false;
      }
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          this.butloading=true;
          this.form.hisVersion =this.queryParams.hisVersion;
          this.form.datasql = this.$refs.monacoEditor.getVal();
          if (this.form.id != null) {
            updateDatasql(this.form).then(response => {
              this.open = false;
            this.$modal.msgSuccess("修改成功");
            this.getList();
            }).finally(() => {this.butloading=false});
          } else {
            addDatasql(this.form).then(response => {
              this.open = false;
            this.$modal.msgSuccess("新增成功");
            this.getList();
            }).finally(() => {this.butloading=false});
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      const hisVersion= this.queryParams.hisVersion;
      this.$modal.confirm('是否确认删除数据项？').then(function() {
        return delDatasql(ids,hisVersion);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.queryParams.ids=JSON.stringify(this.ids);
      this.download('reportworld/datasql/export', {
        ...this.queryParams
      }, `datasql_${new Date().getTime()}.xlsx`)
    },
    tableRowStyle({ row, rowIndex}){
        return getTableRowStyle(row,rowIndex,this.ids);
    },
    rowClick(row, column, event) { //单击行
      this.$refs.datasql.toggleRowSelection(row);
    }
  }
};
</script>
